package model

import (
    "github.com/hfdend/gosql"
    "gougouapi/variables"
)

type Base struct {
    DB      *gosql.DbMysql
}

func (this *Base) Init(tableName string) {
    if this.DB == nil {
        this.DB = gosql.NewDbMysql(variables.MysqlConfig.Host, variables.MysqlConfig.Port, variables.MysqlConfig.User, variables.MysqlConfig.Password, variables.MysqlConfig.DbName)
        this.DB.SetTableName(tableName)
    }
}
